# 作者: 菅世博
# 2025年02月20日14时40分00秒
# 512326042@qq.com


class Animal:  # 基类

    def __init__(self, name):
        self.name = name

    def eat(self):
        print(f'{self.name}eat')

    def run(self):
        print(f'{self.name}run')

    def sleep(self):
        print(f'{self.name}sleep')

    def drink(self):
        print(f'{self.name}drink')


class Dog(Animal):  # 单继承 #若要多继承，则需要在括号中添加多个基类
    def __init__(self, name):
        super.__init__(name)  # 调用父类构造函数
    def bark(self):
        print(f'{self.name}bark')

class XiaoTianQuan(Dog): # 单继承
    def fly(self):
        print(f'{self.name}飞天---')



if __name__ == '__main__':
    wangcai = Dog('旺财')
    wangcai.bark()
    wangcai.sleep()
    xiaoquan = XiaoTianQuan('哮天犬')
    xiaoquan.bark()
    xiaoquan.fly()
